﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using Castle.MicroKernel.Registration;
using Castle.Windsor;
using Ingebet;
using Ingebet.Model;
using Ingebet.Repository;
using Ingebet.Repository.Contract;

namespace Ingebet
{
    public class Global : System.Web.HttpApplication
    {
        public static IWindsorContainer Container;

        private void Application_Start(object sender, EventArgs e)
        {
            // Code qui s'exécute au démarrage de l'application
            //IWindsorContainer Container = new WindsorContainer(new XmlInterpreter());

            Container = new WindsorContainer();
            Container.Register(Component.For<IUtilisateurRepository>().ImplementedBy<UtilisateurRepository>());
            Container.Register(Component.For<UtilisateurModel>());
            Container.Register(Component.For<ISportRepository>().ImplementedBy<SportRepository>());
            Container.Register(Component.For<SportModel>());
            Container.Register(Component.For<ICompetitionRepository>().ImplementedBy<CompetitionRepository>());
            Container.Register(Component.For<CompetitionModel>());
            Container.Register(Component.For<IRencontreRepository>().ImplementedBy<RencontreRepository>());
            Container.Register(Component.For<RencontreModel>());
            Container.Register(Component.For<IEquipeRepository>().ImplementedBy<EquipeRepository>());
            Container.Register(Component.For<EquipeModel>());
            Container.Register(Component.For<ICoteRepository>().ImplementedBy<CoteRepository>());
            Container.Register(Component.For<CoteModel>());
            Container.Register(Component.For<IPariRepository>().ImplementedBy<PariRepository>());
            Container.Register(Component.For<PariModel>());
        }

        protected void Session_Start(object sender, EventArgs e)
        {
        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {
        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {
        }

        protected void Application_Error(object sender, EventArgs e)
        {
        }

        protected void Session_End(object sender, EventArgs e)
        {
        }

        protected void Application_End(object sender, EventArgs e)
        {
        }
    }
}